/*
    created: 2023/4/9
    filename: Bridge.h
    author: 李东霖
    purpose: Bridge模式的演示代码
*/

#ifndef _BRIDGE_H_
#define _BRIDGE_H_

class Implementor; //前置声明Implementor类

class Abstruction
{
public:
    Abstruction(Implementor* pImplementor);
    virtual ~Abstruction();

    //声明一个实现的接口
    void Operation();
protected:
    Implementor* m_pImplementor;
};


//为了实现Abstraction而定义的一个抽象基类，定义了实现的接口函数  
class Implementor
{
public:
    Implementor(){}
    virtual ~Implementor(){} 

    //声明一个纯虚函数，为了实现Abstraction的Operation接口
    virtual void OperationImpl() = 0;   
};

//继承Implementor 
class ConcreteImplementorA:public Implementor
{
public: 
    ConcreteImplementorA(){}
virtual ~ConcreteImplementorA(){}

    //实现继承来的接口  
    virtual void OperationImpl() override;
};

//继承Implementor 
class ConcreteImplementorB:public Implementor
{
public: 
    ConcreteImplementorB(){}
virtual ~ConcreteImplementorB(){}

    //实现继承来的接口  
    virtual void OperationImpl() override;
};


#endif //!_BRIDGE_H_